home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / dflt14.zip / BOX.C < prev    next >
Text File  |  1992-06-30  |  1KB  |  40 lines

  1. /* ----------- box.c ------------ */
  2.  
  3. #include "dflat.h"
  4.  
  5. int BoxProc(WINDOW wnd, MESSAGE msg, PARAM p1, PARAM p2)
  6. {
  7.     int rtn;
  8.     WINDOW oldFocus;
  9.     CTLWINDOW *ct = GetControl(wnd);
  10.     static BOOL SettingFocus = FALSE;
  11.     if (ct != NULL)    {
  12.         switch (msg)    {
  13.             case SETFOCUS:
  14.                 SettingFocus = isVisible(wnd);
  15.                 rtn = BaseWndProc(BOX, wnd, msg, p1, p2);
  16.                 SettingFocus = FALSE;
  17.                    return rtn;
  18.             case PAINT:
  19.                 return FALSE;
  20.             case LEFT_BUTTON:
  21.             case BUTTON_RELEASED:
  22.                 return SendMessage(GetParent(wnd), msg, p1, p2);
  23.             case BORDER:
  24.                 if (SettingFocus)
  25.                     return TRUE;
  26.                 oldFocus = inFocus;
  27.                 inFocus = NULL;
  28.                 rtn = BaseWndProc(BOX, wnd, msg, p1, p2);
  29.                 inFocus = oldFocus;
  30.                 if (ct != NULL)
  31.                     if (ct->itext != NULL)
  32.                         writeline(wnd, ct->itext, 1, 0, FALSE);
  33.                 return rtn;
  34.             default:
  35.                 break;
  36.         }
  37.     }
  38.     return BaseWndProc(BOX, wnd, msg, p1, p2);
  39. }
  40.